import request from '@/utils/request'
import qs from 'qs'

export function queryListByPage(params) {
  return request({
    url: 'api/cronTaskDef' + '?' + qs.stringify(params, { indices: false }),
    method: 'get'
  })
}

export function queryByTaskCode(taskCode) {
  return request({
    url: 'api/cronTaskDef/' + taskCode,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/cronTaskDef',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: 'api/cronTaskDef',
    method: 'put',
    data
  })
}

export function del(pkIds) {
  return request({
    url: 'api/cronTaskDef',
    method: 'delete',
    data: pkIds
  })
}

export function enable(pkIds) {
  return request({
    url: 'api/cronTaskDef/enable',
    method: 'put',
    data: pkIds
  })
}

export function disable(pkIds) {
  return request({
    url: 'api/cronTaskDef/disable',
    method: 'put',
    data: pkIds
  })
}

export default { queryListByPage, queryByTaskCode, add, edit, del, enable, disable }
